<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\select2\Select2;
use yii\helpers\ArrayHelper;

/* @var $this yii\web\View */
/* @var $model app\models\Lunwen */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="lunwen-form">

    <h4><?= Html::encode($model->isNewRecord ? '新建论文>>>' : '更新论文>>>') ?></h4>
    <div class="panel panel-default">
        <!--<div class="panel-heading text-center" style="background: #003eff;color:white">lunwen</div>-->
        <div class="panel-body">
            <?php
            $form = ActiveForm::begin([
                        'options' => ['class' => 'form-horizontal form-group'],
                        'fieldConfig' => [
                            'template' => "{label}<div class=\"col-lg-8\">{input}</div>",
                            'labelOptions' => ['class' => 'col-lg-4', 'style' => 'margin-right:-30px'],
                        ]
            ]);
            ?>


            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">
                    <?= $form->field($model, 'lwno')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'sort')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'gdunit')->textInput(['maxlength' => true]) ?>
                </div>
            </div>


            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">
                    <?= $form->field($model, 'gdno')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'lwname')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'lwname_en')->textInput(['maxlength' => true]) ?>
                </div>
            </div>


            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">

                    <?php
                    $array = [['id' => '1', 'name' => '论文类型1'], ['id' => '2', 'name' => '论文类型2']];
                    echo $form->field($model, 'lwtype')->widget(Select2::classname(), [
                        'data' => ArrayHelper::map($array, 'id', 'name'),
                        'options' => ['placeholder' => '请输入文件类型'],
                        'pluginOptions' => [
                            'allowClear' => true
                        ],
                    ]);
                    ?>
                     <?php
//                $projects = $model::find()->all();
//                foreach ($projects as $item) {
//                    $source[] = $item->lwtype;
//                }
//                echo yii\jui\AutoComplete::widget([
//                    'model' => $searchModel,
//                    'attribute' => 'lwtype',
//                    'options'=>['style'=>'margin-left:10px'],
//                    'clientOptions' => [
//                        'source' => $source,
//                    ],
//                ]);
                ?>   

                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'kwname')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'hxkwtype')->textInput(['maxlength' => true]) ?>
                </div>
            </div>


            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">
                    <?= $form->field($model, 'issnno')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'cnno')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'address')->textInput(['maxlength' => true]) ?>
                </div>
            </div>

            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">
                    <?= $form->field($model, 'iswork')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'publishdate')->textInput() ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'lwfbqk')->textInput(['maxlength' => true]) ?>
                </div>
            </div>


            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">
                    <?= $form->field($model, 'reelno')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'numbertype')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'startpage')->textInput(['maxlength' => true]) ?>
                </div>
            </div>


            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">
                    <?= $form->field($model, 'endpage')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'pagenum')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'logtime')->textInput(['maxlength' => true]) ?>
                </div>
            </div>


            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">
                    <?= $form->field($model, 'wlk')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'gxjsly')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'limittime')->textInput(['maxlength' => true]) ?>
                </div>
            </div>


            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">
                    <?= $form->field($model, 'authornum')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'discipline')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'isproject')->textInput(['maxlength' => true]) ?>
                </div>
            </div>



            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">
                    <?= $form->field($model, 'projectids')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'xgxk')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'zdxk')->textInput(['maxlength' => true]) ?>
                </div>
            </div>


            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">
                    <?= $form->field($model, 'isfinish')->dropDownList(['1' => '是', '0' => '否'], ['prompt' => '请选择']) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'author')->textInput(['maxlength' => true]) ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?php
                    $array = [['id' => '1', 'name' => 'CSSCI'], ['id' => '2', 'name' => 'SSCI'],
                        ['id' => '3', 'name' => 'SCI'], ['id' => '4', 'name' => 'EI'],
                        ['id' => '5', 'name' => 'ISSHP'], ['id' => '6', 'name' => 'ISTP'],
                        ['id' => '7', 'name' => '其他']];
                    echo $form->field($model, 'jsqk')->widget(Select2::classname(), [
                        'data' => ArrayHelper::map($array, 'id', 'name'),
                        'options' => ['placeholder' => '请输入检索情况'],
                        'pluginOptions' => [
                            'allowClear' => true
                        ],
                    ]);
                    ?>
                </div>
            </div>


            <div class="row">
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4" style="text-align:left;">
                    <?php
                    $array = [['id' => '1', 'name' => '一级刊物'], ['id' => '2', 'name' => '二级刊物'],
                        ['id' => '3', 'name' => '三级刊物'], ['id' => '4', 'name' => '普通刊物']];
                    echo $form->field($model, 'kwlevel')->widget(Select2::classname(), [
                        'data' => ArrayHelper::map($array, 'id', 'name'),
                        'options' => ['placeholder' => '请输入刊物类型'],
                        'pluginOptions' => [
                            'allowClear' => true
                        ],
                    ]);
                    ?>
                </div>
                <div class="col-lg-4 col-xs-12 col-sm-4 col-md-4">
                    <?= $form->field($model, 'mark')->textInput(['maxlength' => true]) ?>
                </div>

            </div>

            <div class="col-lg-12 col-xs-12 col-sm-12 col-md-12">
                <div class="form-group">
                    <?= Html::submitButton('保存', ['class' => 'btn btn-success col-lg-offset-5 col-md-offset-5']) ?>
                    <?= Html::a('返回', ['index'], ['class' => 'btn btn-primary']) ?>
                </div>
            </div>

            <?php ActiveForm::end(); ?>
        </div>
    </div>

</div>
